import request from '@/utils/request'

// 新增获奖
export function createPrize(form) {
  return request({
    url: '/api/prize/',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: form
  })
}

// 修改获奖
export function editPrize(id, form) {
  return request({
    url: '/api/prize/' + id + '/',
    method: 'PATCH',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: form
  })
}

// 获取所有获奖
export function getPrize(query) {
  return request({
    url: '/api/prize/',
    method: 'get',
    params: query
  })
}
// 获取所有获奖
export function getMyPrize(query) {
  return request({
    url: '/api/prize/my_prize/',
    method: 'get',
    params: query
  })
}
// 删除获奖
export function deletePrize(id) {
  return request({
    url: '/api/prize/' + id + '/',
    method: 'delete'
  })
}

// 获取团队所有获奖
export function getTeamPrize(query) {
  return request({
    url: '/api/prize/team_list/',
    method: 'get',
    params: query
  })
}

// 获取获奖详情
export function getPrizeDetail(data) {
  return request({
    url: '/api/prize/' + data.id + '/',
    method: 'get'
  })
}

// 获取一级审核
export function getPrizeFirstCheckList(data) {
  return request({
    url: '/api/prize/first_check_list/',
    method: 'get',
    params: data
  })
}

// 获取二级审核
export function getPrizeSecondCheckList(data) {
  return request({
    url: '/api/prize/second_check_list/',
    method: 'get',
    params: data
  })
}

// /一级审核
export function FirstCheckPrize(data) {
  return request({
    url: '/api/prize/' + data.id + '/first_check/',
    method: 'POST',
    data: data
  })
}
// /二级审核
export function SecondCheckPrize(data) {
  return request({
    url: '/api/prize/' + data.id + '/second_check/',
    method: 'POST',
    data: data
  })
}
